/*
 *  This file is part of JEngine.
 *  *
 *  * Copyright (C) 2013-2014 Cetus (http://cs1.com.ua/). All rights reserved.
 *  *
 *  * JEngine is free software: you can redistribute it and/or modify
 *  * it under the terms of the GNU General Public License as published by
 *  * the Free Software Foundation, either version 3 of the License, or
 *  * (at your option) any later version.
 *  *
 *  * JEngine is distributed in the hope that it will be useful,
 *  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  * GNU General Public License for more details.
 *  *
 *  * You should have received a copy of the GNU General Public License
 *  * along with JEngine.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.cetus.jengine.utils.commons;


public class StringUtil {

    static public String caps(String input) {
        StringBuffer tmp = new StringBuffer(input);
        tmp.replace(0, 1, String.valueOf(Character.toUpperCase(tmp.charAt(0))));
        return tmp.toString();
    }

    static public String uncaps(String input) {
        StringBuffer tmp = new StringBuffer(input);
        tmp.replace(0, 1, String.valueOf(Character.toLowerCase(tmp.charAt(0))));
        return tmp.toString();
    }

    static public String toString(String[] input) {
        StringBuilder sb = new StringBuilder();
        for (String n : input) {
            if (sb.length() > 0) sb.append('\n');
            sb.append("'").append(n).append("'");
        }
        return sb.toString();
    }
}
